package com.etc.controller.log;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.etc.common.result.ResultMapper;
import com.etc.logManage.service.ILogOperationService;
import com.etc.logManage.vo.LogOperationVO;

/**
 * @Title: LogController.java
 * @Package com.etc.controller.log
 * @Description: TODO
 * @author 黄宇
 * @date 2016年3月27日 下午8:38:44
 * @version V1.0
 */

@Controller
@RequestMapping("/logOperation")
public class LogOperationController {

	@Autowired
	ILogOperationService logOperationService;

	@RequestMapping(method = RequestMethod.GET)
	@ResponseBody
	public Map<String, Object> list(
			@RequestParam(value = "page", required = false) int page,
			@RequestParam(value = "limit", required = false) int limit) {
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("pageNo", page);
		param.put("pageNum", limit);
		List<LogOperationVO> list = logOperationService.list(param);
		int count = logOperationService.count(param);
		return ResultMapper.convertSuccess(list, count);
	}

}
